// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.

import Vue from 'vue'
import App from './App.vue'
import router from './router'

// import babel from 'babel-polyfill'
// import promise from 'es6-promise';
// import "babel-polyfill"
import '../static/js/home/bootstrap.min.js';

//promise.polyfill()
//Vue.use(es6es);
// Vue.use(router) // 路由

import $ from 'jquery' //全局引用jq
import VueWechatTitle from 'vue-wechat-title';
Vue.use(VueWechatTitle);
import VueI18n from 'vue-i18n'; //国际化中英文
Vue.use(VueI18n) // 引入各个语言配置文件
import zh from './config/language/lang/zh'; // 导入登录页面中文配置
import en from './config/language/lang/en'; // 导入登录页面中文配置
// import en from './utils/lang/en';// 创建vue-i18n实例i18n

import domain from './domain.js';
global.domain = domain;

window.localStorage.setItem('languageval', "zh");
Vue.locale = () => { }
const i18n = new VueI18n({
  // 获取是英文还是中文
  locale: window.localStorage.getItem('languageval') === null ? 'zh' : window.localStorage.getItem('languageval'), // 语言标识
  // 语言转换
  messages: {
    zh,
    en
  },
  // fallbackLocale: 'zh', //如果在message中找不到相应的键值将回退到原本的语言
  // formatFallbackMessages: true //如果在message中找不到相应的键值将回退到原本的语言
});

/* eslint-disable no-new */
new Vue({
  el: '#app',
  router,
  i18n,
  components: { App },
  template: '<App/>'
})
